action_mailer.server_settings = {
  :address => "mail.domain.com",
  :domain => "mail.domain.com",
  :port => 25,
  :authentication => :login,
  :user_name => "xli",
  :password => "l1029O@^2lI31"
}


builder :studio1 => 'http://192.168.0.2:3344'
builder :studio2 => 'http://192.168.0.3:3344'

build :mingle => 'svn://192.168.1.1/mingle' do
  task 'db:test:prepare'

  #search test files, and put into a waiting for test queue
  #when builder requests tests to run, response some tests poped from queue
  #every test poped from queue will be put into waiting test report map
  #when builder posts tests report, 
  #  move tests from waiting test report map to test report ready array with their reports
  #wait until all tests report getted
  #if waiting for test queue is empty, and there is builder request for tests to run,
  #  response some tests get from waiting test report map
  #ignore test report if test is not in the waiting test report map
  #every request and response include a build number
  #the time of test running should be remembered, used to dispatch tests to builders
  run_tests 'test/units/*test.rb'
  run_tests 'test/functional/*test.rb'
  run_tests 'test/integration/*test.rb'
  run_tests 'test/acceptance/story*test.rb'
  run_tests 'test/acceptance/bug*test.rb'

  #package result into the project/dist folder, dmmw will copy it to report lib and display
  #as link on the report page
  dist_task 'package:dist'
  
  send_build_email_to 'xli@thoughtworks.com', 'pwang@thoughtworks.com'

  rebuild_after 30.seconds if failed?
end
